<me:UIVRP x:Class="WPFExcelReport.TCMVR05"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"     
                    xmlns:ZA="clr-namespace:WPFExcelReport;assembly=TZABED"  
                    xmlns:VA="clr-namespace:WPFExcelReport;assembly=TVAART" 
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:ZB="clr-namespace:WPFExcelReport;assembly=TVKZUAB"    
                    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM" 
                    xmlns:VS="clr-namespace:WPFExcelReport;assembly=TVESTAMM"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    FontSize="14"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIVRP.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:PreisConverter  x:Key="price"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVRP.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0">
                <WrapPanel Margin="40,0,0,0">
                    <VS:TSVS02   KEY="{Binding ART,ElementName=TV}"  
                        />
                    <TextBox Text="{Binding ART,ElementName=TV}" Width="180"></TextBox>
                    <CheckBox Content="{Binding Source={Localization:Translate Word=已支付}}" IsChecked="{Binding IsPaid,ElementName=TV}"/>
                    <Button Margin="10,0,0,0" Width="100" Content="{Binding Source={Localization:Translate Word=查询}}" Click="OpenCMCommand" />
                    <WrapPanel Visibility="{Binding IsCanPay,ElementName=TV,Converter={StaticResource bv}}"> 
                        <Button    Click="ManualPayment" Content="{Binding Source={Localization:Translate Word=手动完成支付}}" Height="20" Margin="5,0,0,0" Width="Auto" />
                    </WrapPanel> 
                  
                    </WrapPanel>
                <WrapPanel Visibility="{Binding IsCanPay,ElementName=TV,Converter={StaticResource bv}}"> 
 
                    <WrapPanel Visibility="{Binding IsMPay,ElementName=TV,Converter={StaticResource bv}}">
                        <TextBlock  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=请输入新增支付}}" Foreground="Red"/>
                        <ex:NumericBox   Width="100"
                                          DecimalPlaces="3"
                                   Text="{Binding SVALUE,ElementName=TV}"/>
                        <Button  Click="ManualPayment"   Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>
                </WrapPanel>
                <WrapPanel Grid.Row="0" > 
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=总金额:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"     Text="{Binding VRPGESWERT,Converter={StaticResource ResourceKey=d1000}}" 
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" Width="50" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=货物价值:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"      Text="{Binding VRPWAWERT, Converter={StaticResource ResourceKey=d1000}}" 
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" Width="60" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=数量:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"      
                                       Text="{Binding VRPMENGE,Converter={StaticResource ResourceKey=d100}}"
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"
                                   Width="60" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=单价:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"      Text="{Binding VRPPREIS,Converter={StaticResource ResourceKey=d1000}}"
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"
                                   Width="40" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=比例:}}"></TextBlock>
                        <TextBlock Grid.Column="1"      Text="{Binding VRPZOLLTNR}"  Width="80" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0"  Foreground="Red"  Text="{Binding Source={Localization:Translate Word=原金额:}}"></TextBlock>
                        <TextBlock Grid.Column="1"   Foreground="Red"   
                                   Text="{Binding VRPVGBETRAG}" 
                                 Width="60" />
                    </Grid>
                    <WrapPanel>

                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=预计付款:}}"></TextBlock>
                            <ex:NumericBox MaxLength="8"  Grid.Column="1"      Text="{Binding VRPZFORMDAT}"  Width="120" />
                        </Grid>

                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=实际付款:}}"></TextBlock>
                            <TextBlock Grid.Column="1"      Text="{Binding VRPAEDATUM}"  Width="120" />
                        </Grid>

                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=发货日期:}}"></TextBlock>
                            <TextBlock Grid.Column="1"      Text="{Binding VRPVERSDAT}"  Width="120" />
                        </Grid>

                    </WrapPanel>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=品种}}"/>
                    <VF:TSVA10 Name="cVA10" 
                       IsEdit="{Binding IsEdit,ElementName=TV}"                     
                       ARTST="{Binding ARTST,ElementName=TV}"
                       KEY="{Binding VART,ElementName=TV}"   
                               ORDERNUM="{Binding VART,ElementName=TV}"   
                       Width="Auto" MinWidth="200" />
                </WrapPanel> 
            </StackPanel> 
        </Grid>

        <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"
                    >
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                    <DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                        </DataTemplate>
                    </DataGridCheckBoxColumn.HeaderTemplate>
                </DataGridCheckBoxColumn>
                <DataGridTextColumn Binding="{Binding Path=VRPAPOSTYP}"  Header="{Binding Source={Localization:Translate Word=类型}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPBONKZ}"  Header="{Binding Source={Localization:Translate Word=已付}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPRENR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=发票号}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPREPOS, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=行}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPART,Converter={StaticResource ResourceKey=gb2312}}"  Header="{Binding Source={Localization:Translate Word=品种}}" Width="150" />
                <DataGridTextColumn Binding="{Binding Path=VRPFARBE,Converter={StaticResource ResourceKey=gb2312}}"  Header="{Binding Source={Localization:Translate Word=色号}}" Width="40" />
                <DataGridTextColumn Binding="{Binding Path=VRPAUFKRS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPAUFLFD, Converter={StaticResource ResourceKey=pnum}}"   Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPMENGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPPREIS, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:Translate Word=单价}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPGESWERT, Converter={StaticResource ResourceKey=d1000}}"  Header="{Binding Source={Localization:Translate Word=金额}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPWAWERT, Converter={StaticResource ResourceKey=d1000}}"  Header="{Binding Source={Localization:Translate Word=货物价值}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPZUABWERT1, Converter={StaticResource ResourceKey=d100}}"  Header="{Binding Source={Localization:Translate Word=附加费1}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPZUABWERT2, Converter={StaticResource ResourceKey=d100}}"  Header="{Binding Source={Localization:Translate Word=附加费2}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPZUABWERT3, Converter={StaticResource ResourceKey=d100}}"  Header="{Binding Source={Localization:Translate Word=附加费3}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPZOLLTNR}"  Header="{Binding Source={Localization:Translate Word=比例}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPZFORMDAT}"  Header="{Binding Source={Localization:Translate Word=计划付款}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPAEDATUM}"  Header="{Binding Source={Localization:Translate Word=实际付款}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPVERSDAT}"  Header="{Binding Source={Localization:Translate Word=发货日期}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VRPVLIEFNR}"  Header="{Binding Source={Localization:Translate Word=代理}}" Width="Auto" />

            </DataGrid.Columns>
        </DataGrid  >

        <WrapPanel Grid.Row="2"> 
            <WrapPanel>
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=发票:}}"></TextBlock>
                <TextBlock Grid.Column="1"  Text="{Binding VRPRENR,Converter={StaticResource pnum}}"   Width="Auto" />
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"></TextBlock>
                <TextBlock Grid.Column="2"  Text="{Binding VRPREPOS}"   Width="Auto" />

                <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=销售单:}}"></TextBlock>
                <TextBlock Grid.Column="1"  Text="{Binding VRPAUFKRS}"   Width="Auto" />
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"></TextBlock>
                <TextBlock Grid.Column="2"  Text="{Binding VRPAUFLFD,Converter={StaticResource pnum}}"   Width="Auto" />
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"></TextBlock>
                <TextBlock Grid.Column="3"  Text="{Binding VRPAUFPOS,Converter={StaticResource pnum}}"   Width="Auto" />
            </WrapPanel>
            <TextBlock Text="{Binding Source={Localization:Translate Word=修改:}}"></TextBlock>
            <TextBlock  Text="{Binding VRPAENB}" Width="Auto" />
            <TextBlock Text="{Binding Source={Localization:Translate Word=日期:}}"></TextBlock>
            <TextBlock Text="{Binding VRPAEND}" Width="Auto" />
            <TextBlock Text="{Binding Source={Localization:Translate Word=创建:}}"></TextBlock>
            <TextBlock Text="{Binding VRPNEUB}" Width="Auto" />
            <TextBlock Text="{Binding Source={Localization:Translate Word=日期:}}"></TextBlock>
            <TextBlock Text="{Binding VRPNEUD}" Width="Auto" />
        </WrapPanel>
    </Grid>
</me:UIVRP> 
 
